package com.leancloud.home.adapter;

import android.view.View;
import android.widget.ImageView;

import com.alibaba.android.arouter.launcher.ARouter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.leancloud.home.R;
import com.leancloud.home.entity.ComputingEntity;

import tech.com.commoncore.utils.OnNoDoubleClickListener;

public class HomeHotAdapter extends BaseQuickAdapter<ComputingEntity, BaseViewHolder> {



    public HomeHotAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(final BaseViewHolder helper, ComputingEntity item) {
        ImageView iv = (ImageView) helper.getView(R.id.img_icon);
//        if (item.getIcon() == R.mipmap.home_btn_dingtou){
//            GlideManager.loadImg(R.mipmap.home_btn_dingtou, iv, R.mipmap.home_btn_dingtou);
//        }else if (item.getIcon() == R.mipmap.home_btn_tool){
//            GlideManager.loadImg(R.mipmap.home_btn_tool, iv, R.mipmap.home_btn_tool);
//        }else {
//            GlideManager.loadImg(R.mipmap.home_btn_paihang, iv, R.mipmap.home_btn_paihang);
//        }

//        helper.setText(R.id.tv_title,item.getTitle());
//        helper.setText(R.id.tv_msg,item.getMsg());

        helper.itemView.setOnClickListener(new OnNoDoubleClickListener() {
            @Override
            public void onNoDoubleClick(View v) {
                if (helper.getPosition() == 0){
                    ARouter.getInstance().build("/zixun/aip").navigation();
                }else if (helper.getPosition() == 1){
                    ARouter.getInstance().build("/calculator/computing").navigation();
                }else {
                    ARouter.getInstance().build("/hq/port").navigation();
                }
            }
        });

    }
}
